<template>
	<div>
		<el-card class="box-card">
			<div slot="header" class="clearfix">
				<span>提现通知</span>
				<el-button @click="dialogVisible = true" style="float: right; padding: 3px 0" type="primary">编辑</el-button>
			</div>
			<div>
				<p>
					{{notificationText}}
				</p>
			</div>
		</el-card>
		<el-dialog title="编辑" :visible.sync="dialogVisible" width="30%" :before-close="handleClose">
			<el-input type="textarea" :rows="2" placeholder="请输入内容" v-model="notificationText">
			</el-input>
			<span slot="footer" class="dialog-footer">
	    		<el-button @click="dialogVisible = false">取 消</el-button>
	    		<el-button type="primary" @click="modNotificationText">确 定</el-button>
  			</span>
		</el-dialog>
	</div>
</template>

<script>
	import http from 'assets/js/http.js'

	export default {
		components: {},
		data() {
			return {
				notificationText: '',
				dialogVisible: false
			}
		},
		created() {
			this.init()
		},
		methods: {
			init() {
				// 基本数据获取
				this.tableData()
			},
			tableData() {
				// 表格数据
				const data = {

				}
				// 请求地址
				let url = '/AdminApi/CaiWu/text'
				this.apiPost(url, data).then(res => {
					this.handelResponse(res, data => {
						this.notificationText = data
						_g.closeGlobalLoading()
					})
				})
			},
			modNotificationText() {
				// 表格数据
				const data = {
					content: this.notificationText,
				}
				let url = '/AdminApi/CaiWu/text'
				this.apiPost(url, data).then(res => {
					this.handelResponse(res, data => {
						_g.closeGlobalLoading()
					})
				})
			}
			
		},
		mixins: [http]
	}
</script>

<style scoped>
	.el-input,
	.el-input__inner {
		width: auto;
	}
</style>